package com.lpz.controller;

import com.lpz.damian.Account;
import com.lpz.damian.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 请求参数的绑定
 */
@Controller
@RequestMapping("/param")
public class ParamController {
    @RequestMapping("/testparam")
    public String testparam(String username,String password){//参数名称和jsp的参数名称一样
        System.out.println("执行了参数绑定"+username+password);
        return "success";
    }
    @RequestMapping("/saveAcoount")
    public String saveAcoount(Account username){//参数名称和jsp的参数名称一样,account直接封装了前端提交的东西
        System.out.println("执行了参数绑定"+username);
        return "success";
    }
    //自定义类型转换器
    @RequestMapping("savaUser")
    public String savaUser(User user){
        System.out.println("user的执行"+user);
        return "success";
    }

}
